<?php

class Sgit_Validate_InGroup extends Zend_Validate_Abstract
{


    public function isValid($entrada)
    {
        
        if($entrada['id_user']){
             $id_user=$entrada['id_user'];
        }else{
            $_auth = Zend_Auth::getInstance();
           $id_user=$_auth->getIdentity()->id;
        }
       
        $m_groups = new Application_Model_AclGroup();
        $grupos= $m_groups->getIdGrupoByIdUser($id_user);
       
       
        return in_array($entrada['id_group'],$grupos) ? true : false;

    }
}
